import java.util.Scanner;

/**
    输入不确定个数的数字，判断正负数的个数，输到0停止
    while(true)的使用
 */
public class UncertainNumbers {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int positive = 0, negative = 0;
        System.out.println("input some numbers, 0 to exit:");
        while(true){
            int number = sc.nextInt();
            if(number < 0){
                negative++;
            }
            else if(number > 0){
                positive++;
            }
            else{
                break;
            }
        }
        System.out.println("正数个数为：" + positive);
        System.out.println("负数个数为：" + negative);
    }
}
